package org.example.compent;

import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import com.yomahub.liteflow.enums.NodeTypeEnum;
import com.yomahub.liteflow.slot.DefaultContext;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@LiteflowComponent
public class GCmp {

    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS_SWITCH , nodeId ="g", nodeType = NodeTypeEnum.SWITCH)
    public String process(NodeComponent component) throws Exception {
        DefaultContext contextBean = component.getContextBean(DefaultContext.class);
        String type = contextBean.getData("type");
        log.info("------G结点--------");
        return type;
    }
}
